Skip to content

Fix Game Over screen does not appear when no moves are left in 2048 game#695

Merged
steam-bell-92 merged 1 commit into
steam-bell-92:mainfrom
yuvraj-k-singh:bug/2048-Game
May 23, 2026
Merged

Fix Game Over screen does not appear when no moves are left in 2048 game#695
steam-bell-92 merged 1 commit into
steam-bell-92:mainfrom
yuvraj-k-singh:bug/2048-Game

Conversation

@yuvraj-k-singh
Copy link
Copy Markdown
Contributor

📝 Description

The 2048 game fails to display the "Game Over" message when the board is completely filled and no valid moves are left.

Currently, the check_game_over() function is only called after a successful move. If the player presses an arrow key and no tiles move, the game-over condition is never checked, causing the game to remain stuck without ending properly.

Additionally, multiple "GAME OVER" labels can be created if the function is triggered repeatedly.

🔗 Linked Issue

Closes #628


📋 Contribution Checklist

  • My code strictly adheres to the project guidelines (Standard library only, procedural code, clean spacing).
  • I have verified that my files are placed in the correct directory.
  • I have tested my changes thoroughly on my local machine.
  • I have included interactive emojis and clean console/UI outputs.
  • GSSoC 2026: I have been formally assigned to this issue and noted it above.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

@yuvraj-k-singh is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

@steam-bell-92 steam-bell-92 merged commit 68ed8ef into steam-bell-92:main May 23, 2026
6 of 7 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution!

Your Pull Request has been merged successfully.

We appreciate the time and effort you put into improving this project. Contributions like yours help the repository grow and stay useful for everyone.

If you'd like to contribute again, please check the open issues and make sure you are assigned before opening another Pull Request.

Thanks again for your support! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: Game Over screen does not appear when no moves are left in 2048 game

2 participants